﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BRS.BidModule
{
    public partial class Rolefrm : Form
    {
        Entities brs = new Entities();
        public Rolefrm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text != "" && this.textBox1.Text != null)
            {
                Roles role = new Roles()
                {
                    Name = this.textBox1.Text,
                    IsDel = this.checkBox1.Checked,
                    AddTime=DateTime.Now

                };
                brs.Roles.Add(role);
              var ok=  brs.SaveChanges();
              if (ok == 1) MessageBox.Show("添加角色成功！");

            }
        }
    }
}
